using CommunityToolkit.Mvvm.ComponentModel;

namespace LottieDemo.Models;

/// <summary>
/// 聊天消息模型
/// </summary>
public partial class ChatMessage : ObservableObject
{
    /// <summary>
    /// 消息类型
    /// </summary>
    [ObservableProperty]
    private MessageType _type;

    /// <summary>
    /// 消息内容
    /// </summary>
    [ObservableProperty]
    private string _content;

    /// <summary>
    /// 消息时间戳
    /// </summary>
    [ObservableProperty]
    private DateTime _timestamp;

    /// <summary>
    /// 是否正在加载（仅用于AI消息）
    /// </summary>
    [ObservableProperty]
    private bool _isLoading;

    /// <summary>
    /// 构造函数
    /// </summary>
    public ChatMessage(MessageType type, string content, bool isLoading = false)
    {
        Type = type;
        Content = content;
        Timestamp = DateTime.Now;
        IsLoading = isLoading;
    }
}
